package com.how2j.service.impl;

import com.how2j.mapper.ProductMapper;
import com.how2j.pojo.Product;
import com.how2j.service.ProductService;
import com.how2j.util.PageSite;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Product> list(int cid) {
        List<Product> lists = productMapper.list(cid);
        return lists;
    }

    @Override
    public List<Product> list1(PageSite pageSite) {
        return productMapper.list1(pageSite);
    }

    @Override
    public int total() {
        return productMapper.count();
    }

    @Override
    public Product get(int id) {
        return productMapper.get(id);
    }

    @Override
    public void update(Product product) {
        productMapper.update(product);
    }
}
